<template>
  <div>
    <!-- 搜索 -->
    <!-- 经销商配件管理费率维护及工时系数维护 - 选择经销商 -->
    <!-- <TopFilter :list="topFilterInit" :cols="3" :collapse="collapse" labelWidth="90" @filterChange="changeHandle"></TopFilter> -->
    <!-- table -->
    <FilterTable
      height="auto"
      selectionType="single"
      ref="table"
      :columns="columns"
      :params="fetchParams"
      :fetchapi="fetchapi"
      :datakey="'records'"
      :onColumnsChange="(columns) => (this.columns = columns)"
      :onRowSelectChange="selectChange"
      :isSelectColumn="false"
      :isPagination="false"
    >
    </FilterTable>
    <div
      :style="{
        position: 'absolute',
        left: 0,
        bottom: 0,
        right: 0,
        zIndex: 9,
        borderTop: '1px solid #e9e9e9',
        padding: '10px 20px',
        background: '#fff',
        textAlign: 'right',
      }"
    >
      <multiuse-button @click="closeDialog">关 闭</multiuse-button>
    </div>
  </div>
</template>
<script>
import { qryClaimById } from '@/api/claim/factory/ClaimInvoiceCheck/index';
export default {
  props: ['rowData'],
  // mixins: [dictionary],
  data() {
    return {
      visible: false,
      visibleDrawer: false,
      collapse: false,
      infoId: null,
      topFilterInit: this.topFilterInitFun(),
      flterValue: {}, //参数
      columns: this.creatHeader(),
      fetchapi: qryClaimById,
      fetchParams: {
        id: this.rowData.batchId,
      }, //ipa 接口
      selectedRows: [], //选中经销商
    };
  },
  created() {},
  methods: {
    //搜索数据
    topFilterInitFun() {},
    //搜索获取数据
    changeHandle(val) {
      this.fetchParams = Object.assign({}, this.fetchParams, val);
      console.log(val);
    },
    //table表头和数据源
    creatHeader() {
      return [
        {
          title: '序号',
          dataIndex: 'index',
          width: 80,
          sorter: true,
          render: (props) => {
            return <span>{props.row.index + 1}</span>;
          },
        },
        { title: '索赔类型', dataIndex: 'typeStr', sorter: true },
        { title: '数量', dataIndex: 'num', sorter: true },
        { title: '金额', dataIndex: 'sum', sorter: true },
      ];
    },
    //选中
    selectChange(rows) {
      this.selectedRows = rows;
      console.log(this.selectedRows);
    },
    //保存
    saveDialog() {
      this.$emit('save', this.selectedRows);
    },
    //取消操作
    closeDialog() {
      this.$emit('close', { visible: false, data: this.selectedRows, type: 'close' });
    },
    chooseOrderNo() {
      this.visible = true;
    },
  },
};
</script>

<style lang="less" scoped></style>
